class PredictionClass {
  String? createBy;
  DateTime? createTime;
  String? updateBy;
  DateTime? updateTime;
  String? remark;
  int? predictionOut;
  double? presentOut;
  double? yearRatio;
  double? monthRatio;
  double? maxRatio;
  double? designMaxOut;

  PredictionClass({
    this.createBy,
    this.createTime,
    this.updateBy,
    this.updateTime,
    this.remark,
    this.predictionOut,
    this.presentOut,
    this.yearRatio,
    this.monthRatio,
    this.maxRatio,
    this.designMaxOut,
  });

  factory PredictionClass.fromJson(Map<String, dynamic> json) {
    return PredictionClass(
      createBy: json['createBy'] as String?,
      createTime: DateTime.tryParse(json['createTime'] as String? ?? ''),
      updateBy: json['updateBy'] as String?,
      updateTime: DateTime.tryParse(json['updateTime'] as String? ?? ''),
      remark: json['remark'] as String?,
      predictionOut: json['predictionOut'] as int?,
      presentOut: (json['presentOut'] as num?)?.toDouble(),
      yearRatio: (json['yearRatio'] as num?)?.toDouble(),
      monthRatio: (json['monthRatio'] as num?)?.toDouble(),
      maxRatio: (json['maxRatio'] as num?)?.toDouble(),
      designMaxOut: (json['designMaxOut'] as num?)?.toDouble(),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'createBy': createBy,
      'createTime': createTime?.toIso8601String(),
      'updateBy': updateBy,
      'updateTime': updateTime?.toIso8601String(),
      'remark': remark,
      'predictionOut': predictionOut,
      'presentOut': presentOut,
      'yearRatio': yearRatio,
      'monthRatio': monthRatio,
      'maxRatio': maxRatio,
    };
  }
}
